package a05_双指针法;

/**
 * <p>
 * a05_反转链表复习5
 * </p>
 *
 * @author flyduck
 * @since 2025/5/7
 */
public class a05_反转链表复习5 {
    public ListNode reverseList(ListNode head) {
        ListNode prevNode = null;
        ListNode currNode = head;

        while (currNode != null){
            ListNode nextNode = currNode.next;

            currNode.next = prevNode;


            prevNode = currNode;
            currNode = nextNode;
        }
        return prevNode;

    }
}
